﻿//等待功能层相关模块完成后进行参数统计，然后制作对应的UI界面和存储逻辑
#pragma once

#include <qdialog.h>
#include "ui_ParameterConsole.h"

class ParameterConsole : public QDialog
{
	Q_OBJECT

		//MEMSDataHandler：accuracy、interval_collection
		//ScriptManager：interval_instruction
		//TurnTableCodec：timeInterval_sendInstruction、 turnTablePositionUpperLimit、 turnTablePositionLowerLimit、 turnTableRateUpperLimit、 turnTableRateLowerLimit、 turnTableAccelerationUpperLimit、 turnTableAccelerationLowerLimit
		//TurnTableConnectionStateManager：interval_turnTableConnectionTimeOut、interval_checkThermostatTemperature、interval_checkTurnTableCurrentState、interval_checkTurnTableRunningState
		//MemsAutoTestSoftware：accuracy
private:
	int mEMSAutoTestSoftware_accuracy = 4;
	int mEMSData_accuracy=4;
	int mEMSData_interval_collection=1000;
	int scriptManage_interval_turnTableOperationTimeOut=30000;
	int turnTable_positionUpperLimit=360;
	int turnTable_positionLowerLimit=0;
	int turnTable_rateUpperLimit=5000;
	int turnTable_rateLowerLimit=1;
	int turnTable_accelerationUpperLimit=100;
	int turnTable_accelerationLowerLimit=1;

	Ui::ParameterConsole ui;
public:
	explicit ParameterConsole(QWidget* parent = Q_NULLPTR);
	virtual ~ParameterConsole();
public slots:
	int exec() override;
private slots:
	void accept() override;
	void slot_editingFinished_mEMSAutoTestSoftware_accuracy();
	void slot_editingFinished_mEMSData_accuracy();
	void slot_editingFinished_mEMSData_interval_collection();
	void slot_editingFinished_scriptManage_interval_turnTableOperationTimeOut();
	void slot_editingFinished_turnTable_positionUpperLimit();
	void slot_editingFinished_turnTable_positionLowerLimit();
	void slot_editingFinished_turnTable_rateUpperLimit();
	void slot_editingFinished_turnTable_rateLowerLimit();
	void slot_editingFinished_turnTable_accelerationUpperLimit();
	void slot_editingFinished_turnTable_accelerationLowerLimit();
private:
	void dataStandardizeEditing(QLineEdit* qLineEdit,int defaultValue, int(* dataStandardizeFunction)(int));
	void dataStandardizeUpperLimit(QLineEdit* upperLimitLineEdit, QLineEdit* lowerLimitLineEdit);
	void dataStandardizeLowerLimit(QLineEdit* lowerLimitLineEdit, QLineEdit* upperLimitLineEdit);
public:
	int getMEMSAutoTestSoftware_accuracy();
	void setMEMSAutoTestSoftware_accuracy(int mEMSAutoTestSoftware_accuracy);
	int getMEMSData_accuracy();
	void setMEMSData_accuracy(int mEMSData_accuracy);
	int getMEMSData_interval_collection();
	void setMEMSData_interval_collection(int mEMSData_interval_collection);
	int getScriptManage_interval_turnTableOperationTimeOut();
	void setScriptManage_interval_turnTableOperationTimeOut(int scriptManage_interval_turnTableOperationTimeOut);
	int getTurnTable_positionUpperLimit();
	void setTurnTable_positionUpperLimit(int turnTable_positionUpperLimit);
	int getTurnTable_positionLowerLimit();
	void setTurnTable_positionLowerLimit(int turnTable_positionLowerLimit);
	int getTurnTable_rateUpperLimit();
	void setTurnTable_rateUpperLimit(int turnTable_rateUpperLimit);
	int getTurnTable_rateLowerLimit();
	void setTurnTable_rateLowerLimit(int turnTable_rateLowerLimit);
	int getTurnTable_accelerationUpperLimit();
	void setTurnTable_accelerationUpperLimit(int turnTable_accelerationUpperLimit);
	int getTurnTable_accelerationLowerLimit();
	void setTurnTable_accelerationLowerLimit(int turnTable_accelerationLowerLimit);
};
